#include <qapplication.h>
#include <qfile.h>
#include "view/Profiler.h"
#include <d3d12_command.h>
#include <qfontdatabase.h>
#include "logic/RenderThread.h"

int main(int argc, char *argv[])
{
    d3d12::initialize();
    int res{};
    {
        QApplication a(argc, argv);
        auto ft_id = QFontDatabase::addApplicationFont(":/font/imgui");//Alimama DongFangDaKai
        a.setFont(QFont{ "Alimama DongFangDaKai" ,10 });
        a.setWindowIcon(QIcon{ ":/pic/gt2" });

        QFile sf{ ":/theme/def" };
        if (sf.open(QIODeviceBase::ReadOnly))
        {
            a.setStyleSheet(sf.readAll());
        }

        Profiler w;
        w.show();

        res = a.exec();
    }
    d3d12::shutdown();
    return res;
}
